Patrograd2
|
Curate
|
|
|
Reged: 02/02/04
|
Posts: 564
|
Loc: England
|
|
|
Firstly, if you put a script onto an item that can be carried, and that script includes a messagebox, you might find when the player later sells that item/has it removed from their inventory, that the messagebox appears in the dialogue of the NPC you sell it to/takes it from you.
I had a scirpt on an amulet you were searching for, that basically told you if you were getting close to it. When you hand over that amulet to the quest giver, you get, in white writing at the bottom of the dialogue
Amulet is removed from your inventory Your journal has been updated You feel you are getting close to your goal, what is that glinting on the floor?
Wierd. Fixed by putting this messagebox onto a nearby urn.
Another thing I have found is that the (OnDeath) function is a little buggy. If the NPC has just taken a health potion before dying, then there is a chance that the OnDeath wont be set to 1. Its perhaps a small chance, but nonetheless it does exist. Using (GetHealth < 1 ) doesnt work any better.
The script I use is
if ( OnDeath == 1 ) Journal such and such endif
the answer, presumably, is not to give such NPCs health potions
-------------------- City of Thieves: In Development
Creator of DeathTrap Dungeon
Download Deathtrap Dungeon Version 1.3 here:
http://mwsource.com/center/pafiledb.php?action=file&id=1041
Post Extras:
|
Klinn
|
Disciple
|
|
|
Reged: 11/20/02
|
Posts: 1912
|
|
|
|
Thanks for taking the time to document these little quirks, Patrograd. They'll get cut'n'pasted into something handy so I'll have them around for the future.
...Klinn
Post Extras:
|
MentalElf
|
Adept
|
|
|
Reged: 01/25/04
|
Posts: 351
|
Loc: Hawaii, USA
|
|
|
Yep OnDeath is sometimes missed, even without the potion thing. I always use Gethealth <= 0 with a doOnce condition to detect the dead... even if it missfires it will quickly fire and solve the problem.
-------------------- I think, therefore I code!
MentalElf's Morrowind Page
Post Extras:
|
Grumpy
|
Disciple
|
|
|
Reged: 08/03/02
|
Posts: 1363
|
|
|
|
Probably the same problem I've run into with trying to use == signs with SetPos or GetPos. I know that coordinates are carried out to three decimal places, and the game engine can bypass a set number using the == signs. Does not ascend or decend smoothly in other words, but jumps. Have always had to use a "range" to accomplish the task instead of a set number.
I know fatigue carries to at least a couple of decimal places, so health probably does too.
-------------------- Grumpy
My mods
Post Extras:
|
Patrograd2
|
Curate
|
|
|
Reged: 02/02/04
|
Posts: 564
|
Loc: England
|
|
|
Quote:
Probably the same problem I've run into with trying to use == signs with SetPos or GetPos. I know that coordinates are carried out to three decimal places, and the game engine can bypass a set number using the == signs. Does not ascend or decend smoothly in other words, but jumps. Have always had to use a "range" to accomplish the task instead of a set number.
I know fatigue carries to at least a couple of decimal places, so health probably does too.
So do you think this should read:
if ( ONDeath >= 1 ) Journal etc endif
??
-------------------- City of Thieves: In Development
Creator of DeathTrap Dungeon
Download Deathtrap Dungeon Version 1.3 here:
http://mwsource.com/center/pafiledb.php?action=file&id=1041
Post Extras:
|
Grumpy
|
Disciple
|
|
|
Reged: 08/03/02
|
Posts: 1363
|
|
|
|
Not really, cause I think "IfOndeath" is just boolean (1 or 0).
It's when you use something like a stat or distance check that you would want a spread. Anything that has decimal places in a possible return figure.
I meant this in relation to MentalElf's suggestion for using GetHealth because the return on that carries to two decimal places if I'm not mistaken.
Sorry for the confusion.
-------------------- Grumpy
My mods
Post Extras:
|
Nigedo
|
Diviner
|
|
|
Reged: 05/30/03
|
Posts: 2040
|
Loc: Deep beneath Vvardenfell
|
|
|
Thanks for those tips Patrograd.
On the subject of odd quirks, here's one I discovered while putting together Luthor's Compass.
When you use PlaceAtMe, you have no control over the initial facing position (z rotation) of the placed reference.
If you attempt to test the z rotation it may well return a negative value, e.g. -80 instead of 280. This is contrary to the assumption that all z rotation values should fall between 1 and 360 (or 0) degrees.
If you create an If.. Elseif structure based on the 'GetAngle z' value of the newly placed reference it will often behave erroneously because of the possible negative value.
e.g.
If ( reference->GetAngle z > 180 )
do something
Else
do something different
Endif
This will execute the second set of commands whenever GetAngle z returns a negative value, even though it's true value should fall between 180 and 360.
One way around this is to Rotate the reference for one frame, which appears to reset the value of its z rotation to a true positive value.
i.e.
If ( done == 0 )
reference->RotateWorld z 1
Set done to 1
Endif
-------------------- Dean of The Theoretical Whirling School Of Vivec
The Whirling School | Academy for Dwemer Studies | TES Lore FAQ
Post Extras:
|
MentalElf
|
Adept
|
|
|
Reged: 01/25/04
|
Posts: 351
|
Loc: Hawaii, USA
|
|
|
GetAngle, z :: returns +- 0 to 180 degrees, with 0 degrees due North, positive angles East and negative angles West.
This deviation from 360 degree land is a Bethesda quirk. It's also different from conventional trig in that in trig 0 degrees is due East.
Mapping from trig to Morrowind is a challenging problem I've dealt with many times. Fun stuff!
-------------------- I think, therefore I code!
MentalElf's Morrowind Page
Post Extras:
|